package comits.business.tiers.dao;

import org.hibernate.SQLQuery;
import org.hibernate.context.ManagedSessionContext;

import comits.business.tiers.metiers.Tendance;
import comits.business.tiers.metiers.VenteparSite;
import comits.business.tiers.orm.hibernate.HibernateSession;

public class VenteparSiteDAOImpl implements VenteparSiteDAO{

	public VenteparSite variationt(String Site, int numSite){
		
		SQLQuery sql = HibernateSession.currentSession().createSQLQuery(PropertiesConfig.Get("SelectVPS"))
		.addEntity(VenteparSite.class);
		
//		SQLQuery sql = HibernateSession.currentSession()
//		.createSQLQuery("Select * From venteparsite where Site = ? and NumSite = ?")
//		.addEntity(VenteparSite.class);
		
		sql.setString(0, Site);
		sql.setInteger(1, numSite);
		VenteparSite vps = (VenteparSite) sql.uniqueResult();
		ManagedSessionContext.unbind(HibernateSession.getSessionFactory());
		return vps;
	
		}
}
